import Vue from 'vue'
import Vuex from 'vuex'
import createPersistedState from 'vuex-persistedstate'   //vuex数据持久化

Vue.use(Vuex)

const store = new Vuex.Store({
  plugins:[createPersistedState()],//插件
  state: {
    appphone: null,
    userinfo: null,
    cityinfo:null
  },
  mutations: {
    changeAppPhone(state, payload) {
      state.appphone=payload
    },
    changeUserInfo(state, payload) {
      state.userinfo={...state.userinfo,...payload}
    },
    resetUserInfo(state) {
      state.userinfo = null
    },
    changeCityInfo(state, payload) {
      state.cityinfo = payload
    }
  },
  actions: {
  },
  modules: {
  }
})


export default store;
